NXP backend: Enable constant_pad_nd with new Neutron flow.#19543
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19543
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (2 Unrelated Failures)As of commit 28bb54c with merge base 5971a4b ( BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@novak-vaclav as per usual. |
aa0cd08 to
28bb54c
Compare
novak-vaclav
left a comment
There was a problem hiding this comment.
Great work! 👍 only a few pointers
| # Requirements specified by the new Neutron flow documentation. | ||
|
|
||
| return True | ||
| return True # There are no requirements. |
There was a problem hiding this comment.
The check for io quantization is missing
|
|
||
| import numpy as np | ||
|
|
||
| # noinspection PyUnusedImports |
There was a problem hiding this comment.
nit: why is this necessary? pytest module is used and linter should not complain
| assert graph_contains_any_of_ops(exec_program.graph, [ConstantPadND]) | ||
|
|
||
|
|
||
| class TestConstantPadNDNewNeutronFlow: |
There was a problem hiding this comment.
nit: I would add comment somewhere that the padding tuples go from the last dimension to the first. It took me a while to understand it and a simple comment or hands-on example would be nice.
Something like
Order of inserted padding is backwards, ie:
p2d = (1, 1, 2, 2) # pad the last dim on both sides and second to last dim on both sides
| pytest.param((1, 2, 3, 4, 5), tuple(range(4)), id="5D, padding W, D"), | ||
| ], | ||
| ) | ||
| def test__basic_nsys_inference(self, mocker, input_shape, paddings, use_qat): |
There was a problem hiding this comment.
Don't forget QAT variant.
| print( | ||
| f"NPU output doesn't match reference. Maximum absolute difference: {max_diff}" | ||
| ) | ||
| assert all_close |
Summary
Enable
constant_pad_ndwith new Neutron flow in NXP backend. Reflect the new Neutron requirements and verify correct function.Test plan
Unit tests provided.
cc @robert-kalmar @JakeStevens @digantdesai @rascani